package com.menhai.personmanagement.controller;

import java.util.ArrayList;
import java.util.List;

import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;

import com.menhai.personmanagement.entity.commonProblem;
import com.menhai.personmanagement.mapper.commonProblemMapper;
import lombok.extern.slf4j.Slf4j;


@Slf4j
@RestController
@RequestMapping("/commonProblem")
public class commonProblemController {
	@Autowired
	private commonProblemMapper commonProblemMapper;

	
	@RequestMapping("/selectAll")
	public List<commonProblem> selectAll (commonProblem commonProblem){
		List<commonProblem> commonProblemList = new ArrayList<commonProblem>();
		commonProblemList = selectAllMapper(commonProblem);
        return commonProblemList;
   }
	@RequestMapping("/selectAllText")
	public List<commonProblem> selectAllText (commonProblem commonProblem){
		List<commonProblem> commonProblemList = new ArrayList<commonProblem>();
		commonProblemList = selectAllTextMapper(commonProblem);
        return commonProblemList;
   }
	public List<commonProblem> selectAllMapper(commonProblem commonProblem) {
		return commonProblemMapper.selectAll(commonProblem.getId());
	}
	public List<commonProblem> selectAllTextMapper(commonProblem commonProblem) {
		return commonProblemMapper.selectAllText(commonProblem.getId());
	}
}
